import Vue from 'vue'
import dayjs from 'dayjs'

// 配置语言
import 'dayjs/locale/zh-cn'

import relativeTime from 'dayjs/plugin/relativeTime'
dayjs.extend(relativeTime)

dayjs.locale('zh-cn')

Vue.filter('relativeTime', val => {
  return dayjs().to(dayjs(val))
})
